package net.worldscale.xp.wslib.wsxml;

import java.io.InputStream;

import net.worldscale.xp.wslib.wsxml.sax.SaxParserFactory;
import net.worldscale.xp.wspr.Module;
import net.worldscale.xp.wspr.ModuleKey;
import net.worldscale.xp.wspr.WSPR;

import org.w3c.dom.DOMImplementation;
import org.w3c.dom.Document;

public abstract class WsXML extends Module {

    public final static ModuleKey MODULE_KEY = new ModuleKey(WsXML.class.getName());
    private static WsXML sInst;

    public static WsXML getInstance() {
        WsXML i = sInst;
        if (i == null) {
            i = (WsXML) WSPR.getInstance().getModuleManager().createModule(MODULE_KEY);
            sInst = i;
        }
        return i;
    }

    public abstract Document createDOM(InputStream is, String mime);

    public abstract DOMImplementation getDOMImplementation();

    public abstract SaxParserFactory getSaxParserFactory();

    public abstract DomBuilder newDOMBuilder();
}
